<!--
/**********************************************************************
	Version: FreeRichTextEditor.com Version 1.00.
	License: http://creativecommons.org/licenses/by/2.5/
	Description: Example of how to add freeRTE into a page.
	Author: Copyright (C) 2006  Steven Ewing
**********************************************************************/
-->
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  <title>見たままCMS エディタ Powerd by FreeRTE</title>
<script>
var qsParm = new Array(); 

function retrieveGETqs() { 
  var query = window.location.search.substring(1); 
  var parms = query.split('&'); 
  for (var i=0; i < parms.length; i++) { 
    var pos = parms[i].indexOf('='); 
    if (pos > 0) {
      var key = parms[i].substring(0,pos); 
      var val = parms[i].substring(pos+1); 
      qsParm[key] = val; 
      //alert(key + " : " + decodeURI(val));
    } 
  } 
} 

function updateTextarea() {
  rteModeType('rte_code_mode');
  txt = getXHTML(trim(document.getElementById(rteFormName).value));
  try {
    window.opener.document.getElementById("contents_" + qsParm['id']).value = txt;
  } catch (e) {
    alert("呼び出し元のページを操作されたため、更新できませんでした。");
  }
  //alert(txt);
  window.close();
  return false;
}

</script>
</head>
<body>

<form method="get">
<!-- Include the Free Rich Text Editor Runtime -->
<script src="freerte_v1/js/richtext.js" type="text/javascript" language="javascript"></script>
<!-- Include the Free Rich Text Editor Variables Page -->
<script src="freerte_v1/js/config.js" type="text/javascript" language="javascript"></script>
<!-- Initialise the editor -->
<script>
retrieveGETqs();
try{
  txt = window.opener.document.getElementById("contents_" + qsParm['id']).value;
} catch (e) {
  //alert('存在しないファイルが指定されました。');
  txt = "不正なidが指定されています";
}
initRTE(txt, 'example.css');
//initRTE(decodeURI(qsParm['txt']), 'example.css');
</script>
<input type="button" value="更新" onclick="updateTextarea()">
</form>

</body>
</html>